package ro.k.web.beans.order;

import java.io.Serializable;

public class ManoperaBaseBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4112592938990497236L;
	private String nume;
	private String cod;
	private String valoare;
	private Double cant;
	private Double total;

	public ManoperaBaseBean(String nume, String cod, String valoare) {
		super();
		this.nume = nume;
		this.cod = cod;
		this.valoare = valoare;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((cant == null) ? 0 : cant.hashCode());
		result = prime * result + ((cod == null) ? 0 : cod.hashCode());
		result = prime * result + ((nume == null) ? 0 : nume.hashCode());
		result = prime * result + ((total == null) ? 0 : total.hashCode());
		result = prime * result + ((valoare == null) ? 0 : valoare.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ManoperaBaseBean other = (ManoperaBaseBean) obj;
		if (cant == null) {
			if (other.cant != null)
				return false;
		} else if (!cant.equals(other.cant))
			return false;
		if (cod == null) {
			if (other.cod != null)
				return false;
		} else if (!cod.equals(other.cod))
			return false;
		if (nume == null) {
			if (other.nume != null)
				return false;
		} else if (!nume.equals(other.nume))
			return false;
		if (total == null) {
			if (other.total != null)
				return false;
		} else if (!total.equals(other.total))
			return false;
		if (valoare == null) {
			if (other.valoare != null)
				return false;
		} else if (!valoare.equals(other.valoare))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ManoperaBaseBean [nume=" + nume + ", cod=" + cod + ", valoare="
				+ valoare + ", cant=" + cant + ", total=" + total + "]";
	}

	public ManoperaBaseBean clone() {
		ManoperaBaseBean mbb = new ManoperaBaseBean(nume, cod, valoare);
		mbb.setCant(1.0);
		mbb.setTotal(Double.parseDouble(valoare));
		return mbb;
	}

	public String getNume() {
		return nume;
	}

	public void setNume(String nume) {
		this.nume = nume;
	}

	public String getCod() {
		return cod;
	}

	public void setCod(String cod) {
		this.cod = cod;
	}

	public String getValoare() {
		return valoare;
	}

	public void setValoare(String valoare) {
		this.valoare = valoare;
	}

	public Double getCant() {
		return cant;
	}

	public void setCant(Double cant) {
		this.cant = cant;
	}

	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}
}
